﻿//-------------
// <copyright file="Bootstrapper.cs" company="Uncas">
//     Copyright (c) Ole Lynge Sørensen. All rights reserved.
// </copyright>
//-------------

namespace Uncas.Katas.SimpleMembership.Web
{
    using System.Web.Mvc;
    using Microsoft.Practices.Unity;
    using Uncas.Katas.SimpleMembership.Domain;
    using Uncas.Katas.SimpleMembership.Web.Controllers;

    /// <summary>
    /// The bootstrapper.
    /// </summary>
    public static class Bootstrapper
    {
        /// <summary>
        /// Configures this instance.
        /// </summary>
        public static void Configure()
        {
            var container = new UnityContainer();

            container.RegisterType<IUserRepository, UserRepository>();
            container.RegisterType<IAccountService, AccountService>();

            ControllerBuilder.Current.SetControllerFactory(
                new UnityControllerFactory(container));
        }
    }
}